import {G} from "@/views/flow/globalVar.js";
import {
	inputComponents,
	selectComponents
} from "@/views/flow/createDirectly/generatorForm/config.js";

const publicWork = ({
	                    copyConfigAsCustom,
	                    getConfigByTag
                    })=>{
	return copyConfigAsCustom({
			label: G.APPROVAL_FORM_TYPE_NAME.PUBLIC_WORK,
			explained: G.APPROVAL_FORM_TYPE_NAME.PUBLIC_WORK
		},
		[{
			target: getConfigByTag(selectComponents,
				'el-date-picker'),
			config: {

				vModel: 'publicWorkDate',
				required: true,
				label: '日期',
				labelWidth: 110,
				showDuration: false,
				asSummary: true,
				type: 'date',
				format: 'yyyy-MM-dd',
				clearable: false,
				'value-format': 'yyyy-MM-dd'
			}
		},
			{
				target: getConfigByTag(inputComponents,
					'el-input-number'),
				config: {

					vModel: 'hours',
					required: true,
					label: '小时',
					asSummary: true,
					labelWidth: 110,
					showDuration: false,
					tag: 'el-input-number',
					tagIcon: 'number',
					style: {width: null},
					span: 24,
					min: 0,
					max: 24,
					step: 0.5,
					'controls-position': 'left'
				}
			},
			{
				target: getConfigByTag(inputComponents,
					'el-input'),
				config: {

					vModel: 'fcardInfo',
					label: '打卡信息',
					asSummary: false,
					type: 'textarea'
				}
			},
			{
				target: getConfigByTag(inputComponents,
					'el-input'),
				config: {

					vModel: 'reason',
					label: '备注',
					asSummary: false,
					labelWidth: 110,
					type: 'textarea'
				}
			}])
}


export default publicWork;
